import { uplaodHttpRequest as request } from '@/utils/http';
import type { FileInfoDto } from './type';

enum API {
  DEFAULT_URL = '/api/basics/files'
}

export const fileApi = {
  pictureAddress: `${import.meta.env.VITE_APP_BASE_API}${API.DEFAULT_URL}`
};

// 上传头像
export const uploadAvatarAsync = (data: FormData) =>
  request.post<FileInfoDto>(API.DEFAULT_URL, data);

// 上传文件
export const uploadFileAsync = (data: FormData) => request.post<FileInfoDto>(API.DEFAULT_URL, data);
